﻿namespace SharpTrainer.DP.Singleton.Generic
{
    public class Singleton 
    { 
        private static Singleton instance; 
        
        // Note: Constructor is 'protected' 
        protected Singleton() { } 
        
        public static Singleton Instance() 
        { 
            // Use 'Lazy initialization' 
            if (instance == null) 
            { 
                instance = new Singleton(); 
            } 
            
            return instance;
        } 
    } 
}

